package com.ram.service.impl;

import com.ram.mapper.AssetTransferMapper;
import com.ram.pojo.AssetTransfer;
import com.ram.service.AssetTransferService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.List;

@Service
public class AssetTransferServiceImpl implements AssetTransferService {
    @Autowired
    private AssetTransferMapper transferMapper;

    @Override
    public List<AssetTransfer> list() {
        return transferMapper.list();
    }

    @Override
    public AssetTransfer getById(Integer id) {
        return transferMapper.getById(id);
    }

    @Override
    public void add(AssetTransfer transfer) {
        transfer.setCreateTime(LocalDateTime.now());
        transferMapper.insert(transfer);
    }

    @Override
    public void deleteById(Integer id) {
        transferMapper.deleteById(id);
    }
} 